package com.leisurexi.gedis.client.protocol;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: leisurexi
 * @date: 2021-07-31 15:45
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ResponseProtocol extends Packet {

    private byte result;

    /**
     * 协议版本
     */
    private byte version = 1;

    /**
     * 获取指令码
     */
    private byte command;

    /**
     * 数据长度
     */
    private int dataLen;

    private String data;

    public boolean isSuccess(){
        return result == '+';
    }

}
